#pragma once
#include<iostream>
#include<QString>
using namespace std;
#define ERROR_CODE -2147483648
class fraction {
private:
	int p;
	int q;
public:
	fraction() { p = 0, q = 1; };
	fraction(int a, int b = 1) { p = a, q = b; };
    ~fraction() {};
    int getp(){return p;};
    int getq(){return q;}
	void gcd();
	fraction operator + (fraction&);
	fraction operator - (fraction&);
	fraction operator * (fraction&);
	fraction operator / (fraction&);
	bool operator == (fraction&);
    QString print();
	friend fraction operator +(int, fraction&);
	friend fraction operator +(fraction&, int);
	friend fraction operator -(int, fraction&);
	friend fraction operator -(fraction&, int);
	friend fraction operator *(int, fraction&);
	friend fraction operator *(fraction&, int);
	friend fraction operator /(int, fraction&);
	friend fraction operator /(fraction&, int);
};
